package com.erp.erp_ui.warehouse.enums;

/**
 * @ClassName : OutStockTypeEnum
 * @Description : 出库类型枚举
 * @Author : lst
 * @Date: 2020-08-03 11:51
 */
public enum OutStockTypeEnum {

    SALES_OUT_STOCK(1, "销售出库"),
    OTHER_OUT_STOCK(2, "其它出库");

    /**
     * id
     */
    private int id;

    /**
     * 描述
     */
    private String desc;

    public int getId() {
        return id;
    }

    public String getDesc() {
        return desc;
    }

    OutStockTypeEnum(int id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    /**
     * 通过id获取描述信息
     * @param id
     * @return
     */
    public static String getDescById(int id){
        for(OutStockTypeEnum outStockTypeEnum : OutStockTypeEnum.values()){
            if(outStockTypeEnum.getId() == id){
                return outStockTypeEnum.getDesc();
            }
        }
        return "";
    }
}
